<?php

/**
 * 智能名片
 */

namespace app\api\controller;

use app\common\controller\ApiController;
use think\Exception;
use app\api\model\Follow as FollowModel;
use app\api\model\AgentAttention;
use app\api\model\AgentRemind;
use app\common\lib\RespCode;

class Follow extends ApiController {

    protected $isArrayResult = [];

    /**
     * 客户列表
     */
    public function getFollowList() {
        try {
            $params = $this->checkParams ('agent_user_id,page');
            $FollowModel = new FollowModel();
            $pageSize=10;//每页显示数据数
            $data = $FollowModel->getFollowList ($params,$pageSize);
            return $this->resData ('success', $data);
        } catch (Exception $e) {
            return $this->resErr ($e->getMessage (), $e->getCode ());
        }
    }

    /**
     * 添加客户跟进
     * @return false|string
     */
    public function saveFollow() {
        try {
            $params = $this->checkParams ('agent_user_id,remark');
            $FollowModel = new FollowModel();
            $data = $FollowModel->saveFollow ($params);
            if ($data){
                return $this->resData ('success', []);
            }else{
                return $this->resErr ();
            }
        } catch (Exception $e) {
            return $this->resErr ($e->getMessage (), $e->getCode ());
        }
    }




}
